import { PORT, SERVER_ID } from './config';
import { AccountController } from './controller/account';
import { redisService } from './service/redis';

import {V} from 'x-engine';
import * as express from 'express';
import * as http from 'http';

//注册服务器
setInterval(() => {
    redisService.set('server:token',SERVER_ID,4);
},2000);

//注册控制器
AccountController;


let app = express();
let server = http.createServer(app);

//启动服务器
V.startExpressServer({
    app : app,
    server : server
});

server.listen(PORT);